<template>
  <div style="padding:20px;width:100%">
    <div class="c-flex mb15">
      <div class="c-box-flex">
        <span>用户ID：</span>
        <span class="gray">{{info.uid}}</span>
      </div>
      <div class="c-box-flex">
        <span>手机号码：</span>
        <span class="gray">{{info.phone}}</span>
      </div>
    </div>
    <div class="c-flex mb15">
      <div class="c-box-flex">
        <span>用户类型：</span>
        <span class="gray">{{info.identityType==1?'用户':'网吧主'}}</span>
      </div>
      <div class="c-box-flex">
        <span>会员类型：</span>
        <span class="gray">{{info.vipName}}</span>
      </div>
    </div>
    <div class="c-flex mb15">
      <div class="c-box-flex">
        <span>姓名：</span>
        <span class="gray">{{info.userName}}</span>
      </div>
      <div class="c-box-flex">
        <span>身份证号码：</span>
        <span class="gray">{{idCard}}</span>
      </div>
    </div>
    <div class="c-flex mb15">
      <div class="c-box-flex">
        <span>账户积分：</span>
        <span class="gray">{{info.coin}}</span>
      </div>
      <div class="c-box-flex">
        <span>注册时间：</span>
       <span class="gray">{{$format(info.createTime)}}</span>
      </div>
    </div>
    <div class="c-flex mb15">
      <div class="c-box-flex">
        <span>用户来源：</span>
        <span class="gray">{{info.channel}}</span>
      </div>
      <div class="c-box-flex">
        <span>用户钱包余额（元）：</span>
        <span class="gray">{{info.balance}}</span>
      </div>
    </div>
    <div class="c-flex mb15">
      <div class="c-box-flex" v-for="obj in bank" :key="obj.bankCardNumber">
        <span>绑定银行卡：</span>
        <span class="gray">{{obj.bankCardNumber}}</span>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      info: {},
      bank: [],
      idCard:null
    };
  },
  mounted() {
    this.getinfo();
  },

  methods: {
    getinfo() {
      this.$axios
        .post("/user/userDetails", {
          uid: this.$route.params.id
        })
        .then(res => {
          if ((res.data.code = 200)) {
            this.info = res.data.data.list[0];
            this.bank = res.data.data.bank;
            this.idCard = JSON.stringify(res.data.data.bank)!='[]'?res.data.data.bank[0].idCard:''
          }
        })
        .catch(error => {
          console.log(error);
        });
    }
  }
};
</script>
<style lang="less">
</style>